Integrand size = 23, antiderivative size = 82 \[ \int \frac {\sin ^2(e+f x)}{a+b \tan ^2(e+f x)} \, dx=\frac {(a+b) x}{2 (a-b)^2}-\frac {\sqrt {a} \sqrt {b} \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{(a-b)^2 f}-\frac {\cos (e+f x) \sin (e+f x)}{2 (a-b) f} \]
1/2*(a+b)*x/(a-b)^2-1/2*cos(f*x+e)*sin(f*x+e)/(a-b)/f-arctan(b^(1/2)*tan(f *x+e)/a^(1/2))*a^(1/2)*b^(1/2)/(a-b)^2/f
Time = 0.60 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.84 \[ \int \frac {\sin ^2(e+f x)}{a+b \tan ^2(e+f x)} \, dx=\frac {2 (a+b) (e+f x)-4 \sqrt {a} \sqrt {b} \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )+(-a+b) \sin (2 (e+f x))}{4 (a-b)^2 f} \]
(2*(a + b)*(e + f*x) - 4*Sqrt[a]*Sqrt[b]*ArcTan[(Sqrt[b]*Tan[e + f*x])/Sqr t[a]] + (-a + b)*Sin[2*(e + f*x)])/(4*(a - b)^2*f)
Time = 0.29 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.23, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3042, 4146, 373, 397, 216, 218}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\sin ^2(e+f x)}{a+b \tan ^2(e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin (e+f x)^2}{a+b \tan (e+f x)^2}dx\) |
\(\Big \downarrow \) 4146 |
\(\displaystyle \frac {\int \frac {\tan ^2(e+f x)}{\left (\tan ^2(e+f x)+1\right )^2 \left (b \tan ^2(e+f x)+a\right )}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 373 |
\(\displaystyle \frac {\frac {\int \frac {a-b \tan ^2(e+f x)}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a\right )}d\tan (e+f x)}{2 (a-b)}-\frac {\tan (e+f x)}{2 (a-b) \left (\tan ^2(e+f x)+1\right )}}{f}\) |
\(\Big \downarrow \) 397 |
\(\displaystyle \frac {\frac {\frac {(a+b) \int \frac {1}{\tan ^2(e+f x)+1}d\tan (e+f x)}{a-b}-\frac {2 a b \int \frac {1}{b \tan ^2(e+f x)+a}d\tan (e+f x)}{a-b}}{2 (a-b)}-\frac {\tan (e+f x)}{2 (a-b) \left (\tan ^2(e+f x)+1\right )}}{f}\) |
\(\Big \downarrow \) 216 |
\(\displaystyle \frac {\frac {\frac {(a+b) \arctan (\tan (e+f x))}{a-b}-\frac {2 a b \int \frac {1}{b \tan ^2(e+f x)+a}d\tan (e+f x)}{a-b}}{2 (a-b)}-\frac {\tan (e+f x)}{2 (a-b) \left (\tan ^2(e+f x)+1\right )}}{f}\) |
\(\Big \downarrow \) 218 |
\(\displaystyle \frac {\frac {\frac {(a+b) \arctan (\tan (e+f x))}{a-b}-\frac {2 \sqrt {a} \sqrt {b} \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{a-b}}{2 (a-b)}-\frac {\tan (e+f x)}{2 (a-b) \left (\tan ^2(e+f x)+1\right )}}{f}\) |
((((a + b)*ArcTan[Tan[e + f*x]])/(a - b) - (2*Sqrt[a]*Sqrt[b]*ArcTan[(Sqrt [b]*Tan[e + f*x])/Sqrt[a]])/(a - b))/(2*(a - b)) - Tan[e + f*x]/(2*(a - b) *(1 + Tan[e + f*x]^2)))/f
3.1.63.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a , 0] || GtQ[b, 0])
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_ ), x_Symbol] :> Simp[e*(e*x)^(m - 1)*(a + b*x^2)^(p + 1)*((c + d*x^2)^(q + 1)/(2*(b*c - a*d)*(p + 1))), x] - Simp[e^2/(2*(b*c - a*d)*(p + 1)) Int[(e *x)^(m - 2)*(a + b*x^2)^(p + 1)*(c + d*x^2)^q*Simp[c*(m - 1) + d*(m + 2*p + 2*q + 3)*x^2, x], x], x] /; FreeQ[{a, b, c, d, e, q}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && GtQ[m, 1] && LeQ[m, 3] && IntBinomialQ[a, b, c, d, e, m, 2, p, q, x]
Int[((e_) + (f_.)*(x_)^2)/(((a_) + (b_.)*(x_)^2)*((c_) + (d_.)*(x_)^2)), x_ Symbol] :> Simp[(b*e - a*f)/(b*c - a*d) Int[1/(a + b*x^2), x], x] - Simp[ (d*e - c*f)/(b*c - a*d) Int[1/(c + d*x^2), x], x] /; FreeQ[{a, b, c, d, e , f}, x]
Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_ )])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Sim p[c*(ff^(m + 1)/f) Subst[Int[x^m*((a + b*(ff*x)^n)^p/(c^2 + ff^2*x^2)^(m/ 2 + 1)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x ] && IntegerQ[m/2]
Time = 0.91 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.01
method | result | size |
derivativedivides | \(\frac {-\frac {a b \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {a b}}\right )}{\left (a -b \right )^{2} \sqrt {a b}}+\frac {\frac {\left (-\frac {a}{2}+\frac {b}{2}\right ) \tan \left (f x +e \right )}{1+\tan \left (f x +e \right )^{2}}+\frac {\left (a +b \right ) \arctan \left (\tan \left (f x +e \right )\right )}{2}}{\left (a -b \right )^{2}}}{f}\) | \(83\) |
default | \(\frac {-\frac {a b \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {a b}}\right )}{\left (a -b \right )^{2} \sqrt {a b}}+\frac {\frac {\left (-\frac {a}{2}+\frac {b}{2}\right ) \tan \left (f x +e \right )}{1+\tan \left (f x +e \right )^{2}}+\frac {\left (a +b \right ) \arctan \left (\tan \left (f x +e \right )\right )}{2}}{\left (a -b \right )^{2}}}{f}\) | \(83\) |
risch | \(\frac {x a}{2 \left (a -b \right )^{2}}+\frac {x b}{2 \left (a -b \right )^{2}}+\frac {i {\mathrm e}^{2 i \left (f x +e \right )}}{8 \left (a -b \right ) f}-\frac {i {\mathrm e}^{-2 i \left (f x +e \right )}}{8 \left (a -b \right ) f}-\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-a b}-a -b}{a -b}\right )}{2 \left (a -b \right )^{2} f}+\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-a b}+a +b}{a -b}\right )}{2 \left (a -b \right )^{2} f}\) | \(171\) |
1/f*(-a*b/(a-b)^2/(a*b)^(1/2)*arctan(b*tan(f*x+e)/(a*b)^(1/2))+1/(a-b)^2*( (-1/2*a+1/2*b)*tan(f*x+e)/(1+tan(f*x+e)^2)+1/2*(a+b)*arctan(tan(f*x+e))))
Time = 0.31 (sec) , antiderivative size = 274, normalized size of antiderivative = 3.34 \[ \int \frac {\sin ^2(e+f x)}{a+b \tan ^2(e+f x)} \, dx=\left [\frac {2 \, {\left (a + b\right )} f x - 2 \, {\left (a - b\right )} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + \sqrt {-a b} \log \left (\frac {{\left (a^{2} + 6 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{4} - 2 \, {\left (3 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} + 4 \, {\left ({\left (a + b\right )} \cos \left (f x + e\right )^{3} - b \cos \left (f x + e\right )\right )} \sqrt {-a b} \sin \left (f x + e\right ) + b^{2}}{{\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{4} + 2 \, {\left (a b - b^{2}\right )} \cos \left (f x + e\right )^{2} + b^{2}}\right )}{4 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} f}, \frac {{\left (a + b\right )} f x - {\left (a - b\right )} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + \sqrt {a b} \arctan \left (\frac {{\left ({\left (a + b\right )} \cos \left (f x + e\right )^{2} - b\right )} \sqrt {a b}}{2 \, a b \cos \left (f x + e\right ) \sin \left (f x + e\right )}\right )}{2 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} f}\right ] \]
[1/4*(2*(a + b)*f*x - 2*(a - b)*cos(f*x + e)*sin(f*x + e) + sqrt(-a*b)*log (((a^2 + 6*a*b + b^2)*cos(f*x + e)^4 - 2*(3*a*b + b^2)*cos(f*x + e)^2 + 4* ((a + b)*cos(f*x + e)^3 - b*cos(f*x + e))*sqrt(-a*b)*sin(f*x + e) + b^2)/( (a^2 - 2*a*b + b^2)*cos(f*x + e)^4 + 2*(a*b - b^2)*cos(f*x + e)^2 + b^2))) /((a^2 - 2*a*b + b^2)*f), 1/2*((a + b)*f*x - (a - b)*cos(f*x + e)*sin(f*x + e) + sqrt(a*b)*arctan(1/2*((a + b)*cos(f*x + e)^2 - b)*sqrt(a*b)/(a*b*co s(f*x + e)*sin(f*x + e))))/((a^2 - 2*a*b + b^2)*f)]
Timed out. \[ \int \frac {\sin ^2(e+f x)}{a+b \tan ^2(e+f x)} \, dx=\text {Timed out} \]
Time = 0.32 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.13 \[ \int \frac {\sin ^2(e+f x)}{a+b \tan ^2(e+f x)} \, dx=-\frac {\frac {2 \, a b \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b}}\right )}{{\left (a^{2} - 2 \, a b + b^{2}\right )} \sqrt {a b}} - \frac {{\left (f x + e\right )} {\left (a + b\right )}}{a^{2} - 2 \, a b + b^{2}} + \frac {\tan \left (f x + e\right )}{{\left (a - b\right )} \tan \left (f x + e\right )^{2} + a - b}}{2 \, f} \]
-1/2*(2*a*b*arctan(b*tan(f*x + e)/sqrt(a*b))/((a^2 - 2*a*b + b^2)*sqrt(a*b )) - (f*x + e)*(a + b)/(a^2 - 2*a*b + b^2) + tan(f*x + e)/((a - b)*tan(f*x + e)^2 + a - b))/f
Time = 0.49 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.32 \[ \int \frac {\sin ^2(e+f x)}{a+b \tan ^2(e+f x)} \, dx=-\frac {\frac {2 \, {\left (\pi \left \lfloor \frac {f x + e}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (b\right ) + \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b}}\right )\right )} a b}{{\left (a^{2} - 2 \, a b + b^{2}\right )} \sqrt {a b}} - \frac {{\left (f x + e\right )} {\left (a + b\right )}}{a^{2} - 2 \, a b + b^{2}} + \frac {\tan \left (f x + e\right )}{{\left (\tan \left (f x + e\right )^{2} + 1\right )} {\left (a - b\right )}}}{2 \, f} \]
-1/2*(2*(pi*floor((f*x + e)/pi + 1/2)*sgn(b) + arctan(b*tan(f*x + e)/sqrt( a*b)))*a*b/((a^2 - 2*a*b + b^2)*sqrt(a*b)) - (f*x + e)*(a + b)/(a^2 - 2*a* b + b^2) + tan(f*x + e)/((tan(f*x + e)^2 + 1)*(a - b)))/f
Time = 11.42 (sec) , antiderivative size = 190, normalized size of antiderivative = 2.32 \[ \int \frac {\sin ^2(e+f x)}{a+b \tan ^2(e+f x)} \, dx=\frac {b\,\sin \left (2\,e+2\,f\,x\right )-a\,\sin \left (2\,e+2\,f\,x\right )+2\,a\,\mathrm {atan}\left (\frac {\sin \left (e+f\,x\right )}{\cos \left (e+f\,x\right )}\right )+2\,b\,\mathrm {atan}\left (\frac {\sin \left (e+f\,x\right )}{\cos \left (e+f\,x\right )}\right )-\mathrm {atan}\left (\frac {b^3\,\sin \left (e+f\,x\right )\,\sqrt {-a\,b}\,1{}\mathrm {i}-a\,b^2\,\sin \left (e+f\,x\right )\,\sqrt {-a\,b}\,2{}\mathrm {i}+a^2\,b\,\sin \left (e+f\,x\right )\,\sqrt {-a\,b}\,1{}\mathrm {i}}{\cos \left (e+f\,x\right )\,a^3\,b-2\,\cos \left (e+f\,x\right )\,a^2\,b^2+\cos \left (e+f\,x\right )\,a\,b^3}\right )\,\sqrt {-a\,b}\,4{}\mathrm {i}}{4\,f\,a^2-8\,f\,a\,b+4\,f\,b^2} \]
(b*sin(2*e + 2*f*x) - a*sin(2*e + 2*f*x) + 2*a*atan(sin(e + f*x)/cos(e + f *x)) + 2*b*atan(sin(e + f*x)/cos(e + f*x)) - atan((b^3*sin(e + f*x)*(-a*b) ^(1/2)*1i - a*b^2*sin(e + f*x)*(-a*b)^(1/2)*2i + a^2*b*sin(e + f*x)*(-a*b) ^(1/2)*1i)/(a*b^3*cos(e + f*x) - 2*a^2*b^2*cos(e + f*x) + a^3*b*cos(e + f* x)))*(-a*b)^(1/2)*4i)/(4*a^2*f + 4*b^2*f - 8*a*b*f)